package com.zhouheng.springbootdesignpattern.abstractfactorypattern;

/**
 * 产品工厂，返回颜色或形状工厂
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String choice) {
        if ("SHAPE".equalsIgnoreCase(choice)) {
            return new ShapeFactory();
        } else if ("COLOR".equalsIgnoreCase(choice)) {
            return new ColorFactory();
        }
        return null;
    }

}